package com.imooc.product.exception;

import com.imooc.product.enums.ResultEnum;

/**
 * @author wy
 * @version 1.0
 * @date 2020/3/9 21:54
 * @description
 **/
public class ProductException extends RuntimeException{
    private Integer code;

    public ProductException(Integer code,String message){
        super(message);
        this.code = code;
    }

    public ProductException(ResultEnum resultEnum){
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }
}
